<template>

  <el-row>
    <el-col :span="3"></el-col>
    <el-col :span="18">
      <div>
        <!--       表格 -->
        <el-table :data="cutObj" style="width: 100%;margin-bottom: 20px " border stripe>
          <el-table-column prop="title" label="标题"/>
          <el-table-column prop="type" label="类型"/>
          <el-table-column label="操作">
            <template #default="scope">
              <el-button type="primary" @click="findById(scope.row.noteEsId)">预览</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-button @click="this.$router.push('/note/show')">返回首页</el-button>
      </div>
    </el-col>
    <el-col :span="3"></el-col>
  </el-row>


</template>
<script>
import axios from "axios";

export default {
  data() {
    return {
      cutObj: [],
      info: ''
    }
  }, methods: {
    init() {
      axios.get("/project/note/findByAllInfo", {params: {info: this.info}}).then(resp => {
        console.log(resp.data)
        this.cutObj = resp.data;
        this.$router.push('/note/showInfo');
      })
    }, findById(noteEsId) {
      console.log(noteEsId);
      sessionStorage.setItem("id", noteEsId);
      this.$router.push("/note/noteInfo");
    }
  }
  , created() {
    this.info = sessionStorage.getItem("info");
    console.log(this.info)
    this.init()

  }
}
</script>

<style scoped>

</style>